package com.levy.contronller.javase.designModel.single;

/**
 *
 * 内存中始终只存在一个对象 保证性能
 * Created by levy on 2018/8/1.
 */
public class MainClass {

    public static void main(String[] args) {
        Person person2Check = Person.getPerson2Check();
        person2Check.setAge(18);

        Person personLazy = Person.getPersonLazy();
        System.out.println(personLazy == person2Check);
        System.out.println(personLazy.getAge());

        Person personHungry = Person.getPersonHungry();

    }
}
